Conversation
…public attr to event model, a function that adds a user to existing event and test for that function.
…ntent given as a var, and also a func that sends email to all participants in event.
…t creation. fixing tests. tests are not working properly yet!
…still bugs inside
… event participants.
…into feature/public_event
| color = Column(String, nullable=True) | ||
| availability = Column(Boolean, default=True, nullable=False) | ||
| invitees = Column(String) | ||
| is_public = Column(Boolean, default=False) |
There was a problem hiding this comment.
Event doesn't have "friends" option?
There was a problem hiding this comment.
the meaning of friends is different- public event is meant to allow any user in the platform to join the event, just like the public events on facebook. so it means the owner's friends don't matter in this feature :)
There was a problem hiding this comment.
Can you please explain what is the meaning of public/private event? is it like busy/free?
Thanks
There was a problem hiding this comment.
a pubic event is event anyone can join. it means you don't need to be invited directly from the owner, you can join the event by yourself by clicking a button on event page
|
|
||
|
|
||
| @pytest.fixture | ||
| def new_user(session): |
There was a problem hiding this comment.
maybe you can use existing fixtures?
There was a problem hiding this comment.
Tried but didn't really find a proper user fixture inside the file. ill try going over the code again
There was a problem hiding this comment.
There are enough user fixtures, use one of the others.
Codecov Report
@@ Coverage Diff @@
## develop #287 +/- ##
===========================================
- Coverage 98.01% 97.63% -0.39%
===========================================
Files 68 68
Lines 2979 3002 +23
===========================================
+ Hits 2920 2931 +11
- Misses 59 71 +12
Continue to review full report at Codecov.
|
…ead of bool of whether emails were send. tried simple tests for it
…sending is supposed to fail) and the second where event owner sends email
yammesicka
left a comment
There was a problem hiding this comment.
Great job! Please see my insights, and use precommit hooks to format your code automatically :)
yammesicka
left a comment
There was a problem hiding this comment.
Most of the problems in this version could be resolved easily using git precommit hooks.
Please run black or git precommit hooks on this code and I'll check it again :)
app/internal/email.py
Outdated
| templates, | ||
| ) | ||
| from app.database.models import Event, User, UserEvent | ||
| from app.internal.utils import get_current_user |
There was a problem hiding this comment.
Please use Kobi's user system instead
tests/conftest.py
Outdated
| @pytest.fixture | ||
| def no_event_user(session): | ||
| """a user made for testing who doesn't own any event.""" | ||
| user = create_user( | ||
| session=session, | ||
| username='new_test_username', | ||
| password='new_test_password', | ||
| email='new2_test.email@gmail.com', | ||
| language_id='english' | ||
| ) | ||
|
|
||
| return user |
There was a problem hiding this comment.
Don't create a new fixture, use one of the others.
There was a problem hiding this comment.
i have to use several different users since i'm testing the use of the mailing list.
tests/conftest.py
Outdated
| @pytest.fixture | ||
| def event_owning_user(session): | ||
| """a user made for testing who already owns an event.""" | ||
| user = create_user( | ||
| session=session, | ||
| username='new_test_username2', | ||
| password='new_test_password2', | ||
| email='new_test_love231.email@gmail.com', | ||
| language_id='english' | ||
| ) | ||
|
|
||
| data = { | ||
| 'title': 'event_owning_user event', | ||
| 'start': datetime.strptime('2021-05-05 14:59', '%Y-%m-%d %H:%M'), | ||
| 'end': datetime.strptime('2021-05-05 15:01', '%Y-%m-%d %H:%M'), | ||
| 'location': 'https://us02web.zoom.us/j/875384596', | ||
| 'content': 'content', | ||
| 'owner_id': user.id, | ||
| } | ||
|
|
||
| create_event(session, **data) | ||
|
|
||
| return user |
There was a problem hiding this comment.
Don't create a new fixture, use one of the others. You can use a user fixture and an event fixture in your code to create this.
There was a problem hiding this comment.
i have to use several different users since i'm testing the use of the mailing list.
__
tests/conftest.py
Outdated
| @pytest.fixture | ||
| def user1(session): | ||
| """another user made for testing""" | ||
| user = create_user( | ||
| session=session, | ||
| username='user2user2', | ||
| password='verynicepass', | ||
| email='trulyyours1.email@gmail.com', | ||
| language_id='english' | ||
| ) | ||
| return user |
There was a problem hiding this comment.
Don't create a new user fixture, use one of the others.
There was a problem hiding this comment.
i have to use several different users since i'm testing mailing list.
| @pytest.fixture | ||
| def event_example(session, event_owning_user): | ||
| data = { | ||
| 'title': 'test event title', | ||
| 'start': datetime.strptime('2021-05-05 14:59', '%Y-%m-%d %H:%M'), | ||
| 'end': datetime.strptime('2021-05-05 15:01', '%Y-%m-%d %H:%M'), | ||
| 'location': 'https://us02web.zoom.us/j/87538459r6', | ||
| 'content': 'content', | ||
| 'owner_id': event_owning_user.id, | ||
| } | ||
|
|
||
| event = create_event(session, **data) | ||
| return event |
There was a problem hiding this comment.
Don't create a new event fixture, use one of the others.
|
|
||
|
|
||
| @pytest.fixture | ||
| def new_user(session): |
There was a problem hiding this comment.
There are enough user fixtures, use one of the others.
…ndar into feature/public_event
…into feature/public_event
a feature that supports describing an event as a public event. as a part of this definition, it will allow sending emails to all event participants and allow joining events on the event page.